package com.future.jdk;

import java.lang.reflect.Proxy;

/**
 * Hello world!
 * jdk动态代理
 *
 * @author future
 */
public class App {
    public static void main(String[] args) {
        Animal animal = new Animal();
        AnimalInterface animalInterface = (AnimalInterface) Proxy.newProxyInstance(
                AnimalInterface.class.getClassLoader(),
                new Class[]{AnimalInterface.class},
                new AnimalProxyHandler(animal));
        animalInterface.soundNex();
    }

}
